def isParamsInProjectName = currentBuild.projectName.endsWith(")")
def nodeName = isParamsInProjectName ? currentBuild.projectName.find(/\(([^\)]+)\)/, {group -> group[1]}) : params.NODE_NAME
println "nodeName: ${nodeName}"

node(nodeName) {

//    checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[cancelProcessOnExternalsFail: true, credentialsId: 'jcyy_svn_credential', depthOption: 'infinity', ignoreExternalsOption: true, local: '.', remote: 'http://114.55.64.147/svn/rbm/trunk']], quietOperation: true, workspaceUpdater: [$class: 'UpdateUpdater']])
    checkout([$class: 'SubversionSCM', additionalCredentials: [], excludedCommitMessages: '', excludedRegions: '', excludedRevprop: '', excludedUsers: '', filterChangelog: false, ignoreDirPropChanges: false, includedRegions: '', locations: [[cancelProcessOnExternalsFail: true, credentialsId: 'jcyy_svn_credential', depthOption: 'infinity', ignoreExternalsOption: true, local: '.', remote: 'http://114.55.64.147/svn/mdm/trunk']], quietOperation: true, workspaceUpdater: [$class: 'UpdateUpdater']])
//    checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://gitee.com/bjwangwei/gitee-test.git']]])
    def build = load 'jenkins/deploy-scripts/javaServerBuild.groovy'

    build.build()
}